<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>留言板</title>
    <script src="jquery.js"></script>
    <script>
        function addContent(){
            const content = $("#content").val()
            if(content == ""){
                return;
            }
            $("#list").append(`<li>${content} <button onclick="deleteRow(this)">删除</button> </li>`)
            $("#content").val('')
        }

        function deleteRow(btn){
            $(btn).parents("li").remove();
        }
    </script>
</head>
<body>
    <div>
        <h1>简易留言板</h1>
        <p>
            <input id="content" placeholder="请输入留言"/>
            <button onclick="addContent()">留言</button>
        </p>
        <ul id="list">
<!--            <li>收到请回复 <button onclick="deleteRow(this)">删除</button> </li>-->
        </ul>
    </div>
</body>
</html>